Refactor environment variable processing for Docker #50221
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of #49612.
The current Docker entrypoint script picks up environment variables and
translates them into -E command line arguments. However, since any tool
executed via
docker exec
doesn't run the entrypoint, it results ina poorer user experience.
This PR refactors the env var handling so that the -E options are
generated in
elasticsearch-env
. These have to be appended to anyexisting command arguments, since some CLI tools have subcommands and
-E arguments must come after the subcommand.
Also extract the support for
_FILE
env vars into a separate script, sothat it can be called from more than once place (the behaviour is
idempotent).
Finally, add noop
-E
handling toCronEvalTool
for parity, and support-E
in
MultiCommand
before subcommands.